#include <stdio.h>
#include <stdlib.h>

struct Node {
    int data;
    struct Node *next;
};

void insert(struct Node **head, int data) {
    struct Node *newNode = (struct Node*)malloc(sizeof(struct Node));
    newNode->data = data;
    newNode->next = NULL;

    if (*head == NULL) {
        *head = newNode;
        return;
    }

    struct Node *current = *head;
    while (current->next != NULL) {
        current = current->next;
    }
    current->next = newNode;
}

void release(struct Node **head) {
    struct Node *current = *head;
    while (current != NULL) {
        struct Node *temp = current;
        current = current->next;
        free(temp);
    }
}

int findMinimum(struct Node *head) {
    int minValue = head->data;
    struct Node *current = head->next;
    while (current != NULL) {
        if (current->data < minValue) {
            minValue = current->data;
        }
        current = current->next;
    }
    return minValue;
}

int main() {
    int n;
    scanf("%d", &n);
    struct Node *head = NULL;

    for (int i = 0; i < n; i++) {
        int value;
        scanf("%d", &value);
        insert(&head, value);
    }

    int minValue = findMinimum(head);
    printf("%d\n", minValue);

    release(&head);

    return 0;
}
